package com.example.hw_calendar_View;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.hw_calendar.R;
import com.example.hw_calendar_DB.ToDoItemData;

public class ItemDataListView extends LinearLayout {

	TextView dateView;
	TextView titleView;
	ToDoItemData mToDoItemData;
	
	public interface OnItemDataClickListener{
		public void onItemData(View v, ItemDataListView data);
	}
	
	OnItemDataClickListener mListener;
	
	public void setOnItemDataClickListener(OnItemDataClickListener listener){
		mListener = listener;
	}
	
	public ItemDataListView(Context context) {
		super(context);
		LayoutInflater.from(context).inflate(R.layout.list_item, this);
		dateView = (TextView)findViewById(R.id.scheduleDate);
		titleView = (TextView)findViewById(R.id.scheduleTitle);
	}

	public void setData(ToDoItemData itemData){
		mToDoItemData = itemData;
		dateView.setText(itemData.year + "." + (itemData.month+1) + "." + itemData.day);
		titleView.setText(itemData.title);
	}
}
